#!/bin/bash

echo "this is shell function test"


name(){
    whoami
}


function func1 {
    echo "this is a function"
}

func1
name
echo "return from function name :"$?

double(){
    read -p "Enter a number :" num
    echo "double the number"
    return $[ $num * 2 ]
}

double
echo "return from function double :"$?

double
func1
echo "return from function double ? or func1 :"$?

anotherDouble(){
    read -p "enter a value :" val
    echo "Double the value"
    echo $[ $val * 2 ]
}

echo "return from function anotherDouble :" `anotherDouble`


